import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../views/Login.vue"

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Login,
    name: 'login'
  },
  {
    path: '/home',
    component: () => import("../views/Home.vue"),
    name: 'home',
    children: [
      {
        path: '/',//后台首页
        name: '/home/index',
        component: () => import("../views/modules/Index.vue"),
      },
      {
        path: 'order',//订单管理
        name: '/home/order',
        component: () => import("../views/modules/Order.vue"),
      },
      {
        path: 'productlist',//商品管理
        name: '/home/productlist',
        component: () => import("../views/modules/product/Productlist.vue"),
      },
      {
        path: 'productadd',//商品添加
        name: '/home/productadd',
        component: () => import("../views/modules/product/Productadd.vue"),
      },
      {
        path: 'producttype',//商品类型
        name: '/home/producttype',
        component: () => import("../views/modules/product/Producttype.vue"),
      },
      {
        path: 'store',//商铺管理
        name: '/home/store',
        component: () => import("../views/modules/Store.vue"),
      },
      {
        path: 'account',//账号列表
        name: '/home/account',
        component: () => import("../views/modules/user/Account.vue"),
      },
      {
        path: 'addaccount',//添加账号
        name: '/home/addaccount',
        component: () => import("../views/modules/user/Accountadd.vue"),
      },
      {
        path: 'changepwd',//修改密码
        name: '/home/changepwd',
        component: () => import("../views/modules/user/Changepwd.vue"),
      },
      {
        path: 'productall',//商品统计
        name: '/home/productall',
        component: () => import("../views/modules/sales/ProductAll.vue"),
      },
      {
        path: 'orderall',//订单统计
        name: '/home/orderall',
        component: () => import("../views/modules/sales/OrderAll.vue"),
      },
      {
        path: 'money',//开通会员
        name: '/home/money',
        component: () => import("../views/modules/Money.vue"),
      }, {
        path: 'personal',//个人中心
        name: '/home/personal',
        component: () => import("../views/modules/Personal.vue"),
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
